A 68-year-old man with a history of poorly controlled type 2 diabetes, hypertension, and chronic kidney disease (stage 3) presents to the emergency department with severe abdominal pain and vomiting. On examination, he has a distended abdomen with diffuse tenderness and guarding. His vital signs show a blood pressure of 90/60 mmHg, heart rate of 110 bpm, and a temperature of 38.5°C. Laboratory tests reveal leukocytosis, elevated serum lactate, and worsening renal function. A CT scan of the abdomen shows pneumoperitoneum and free fluid, suggesting perforated viscus. What is the most appropriate next step in the management of this patient?